package com.woniuxy.carrental.service.impl;

import com.woniuxy.carrental.entity.Car;
import com.woniuxy.carrental.mapper.CarMapper;
import com.woniuxy.carrental.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author xilei
 * @create 2021-09-29 下午 6:49
 */
@Service
public class CarServiceImpl implements CarService {
    @Resource
    CarMapper carMapper;

    @Override
    public List<Car> findCar() {
        List<Car> list = carMapper.findCar();
        return list;
    }

    @Override
    public List<Car> findCarByPage(int pageIndex, int pageSize) {
        List<Car> list = carMapper.findCarByPage(pageIndex, pageSize);
        return list;
    }

    @Override
    public List<Car> findCarByPageByParam(String car_name, String car_type, String car_vehicle, int pageIndex, int pageSize) {
        List<Car> list = carMapper.findCarByPageByParam(car_name, car_type, car_vehicle, pageIndex, pageSize);
        return list;
    }

    @Override
    public void insertCar(Car car) {
        carMapper.insertCar(car);
    }



    @Override
    public void deleteCar(Integer car_id) {
        carMapper.deleteCar(car_id);
    }

    @Override
    public void updateCar(String car_name, String car_type, String car_vehicle, String car_picture, Integer car_id) {
        carMapper.updateCar(car_name, car_type, car_vehicle, car_picture, car_id);
    }

}
